#include <iostream>
#include<cmath>
using namespace std;
int main()
{
    int n;  
    while(cin>>n)
    {
        int count=0;  
        for(int k=2;k<=n;k++)  
        {
            int sum=1;  
            for(int i=2;i<=sqrt(k);i++) 
            {
                if(k%i==0)
                    sum=sum+i+k/i;
            }
            if(k==sum)
                count++;
        }
        cout<<count<<endl;
    }
    return 0;
}